package com.zlm.app.emp.service;

import com.zlm.common.dto.JsonResultDto;
import org.apache.ibatis.annotations.Param;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 调用zlm-external第三方集成服务
 * @Author: duyufu
 * @Date: 2019/7/8 10:42
 */
@FeignClient(value = "zlm-external",fallback = ExternalFallback.class)
@Service
public interface ExternalService {

    /**
     * 环信注册
     * @param userId
     * @return
     */
    @GetMapping("/huanxin/huanxinRegister")
    JsonResultDto huanxinRegister(@RequestParam("userId") Integer userId,
                                  @RequestParam("systemCode") String systemCode);

    /**
     * 环信添加好友
     * @param ownerUsername
     * @param friendUsername
     * @return
     */
    @GetMapping("/huanxin/huanxinAddFriend")
    JsonResultDto huanxinAddFriend(@RequestParam("ownerUsername") String ownerUsername,@RequestParam("friendUsername") String friendUsername);

    /**
     * 环信删除好友
     * @param ownerUsername
     * @param friendUsername
     * @return
     */
    @GetMapping("/huanxin/huanxinDeleteFriend")
    JsonResultDto huanxinDeleteFriend(@RequestParam("ownerUsername") String ownerUsername,@RequestParam("friendUsername") String friendUsername);

    /**
     * 环信强制下线
     * @param username
     * @return
     */
    @GetMapping("/huanxin/huanxinDisconnect")
    JsonResultDto huanxinDisconnect(@RequestParam("username") String username);
}
